IBM Books

Using and Configuring Features Version 3.4


Using the Differentiated Services Feature

This chapter describes how to use the Differentiated Services (DiffServ) feature so that a router can provide preferred service to appropriate IP data packets. Based on information in the IP header, the router classifies packets by matching them with predefined configurations in the policy database (created with the policy feature). See "Using the Policy Feature" for details. As a result, some packets may receive preferred service. This chapter consists of the following sections:


Overview of Differentiated Services

Most forwarding devices installed in an IP network today deliver standard best-effort service to data packets on a first-come, first-served basis. This delivery method is adequate for most traffic, but new applications are emerging that require faster and earlier transmission of certain packets.

The Differentiated Services (DiffServ) feature provides different levels of service to IP packets when a router processes them for transmission. DiffServ provides some packets with preferred service by reserving system resources (buffers) and link resources (bandwidth) for them. A DiffServ classifier function determines the type of service given to IP packets by examining various fields in the IP header, for example, ranges of IP source and destination addresses and port numbers, protocol type, and incoming DS (TOS) byte. To accomplish this in a scalable way, individual flows are aggregated into streams. Streams are the entities through which DiffServ manages access to buffers and bandwidth. Figure 39 shows how DiffServ processes the packets of a stream.

Figure 39. DiffServ Data Packet Path


Figure of DiffServ Data Packet Path

In addition to the traditional best-effort service, DiffServ provides the following types of service:

Expedited Forwarding (EF)
Expedited forwarding service represents the DiffServ implementation of premium service and both terms are used interchangeably in the following text. This service guarantees a specific transmission rate and lower delay than either assured forwarding or best-effort service. If excess traffic develops, DiffServ drops the excess traffic. The premium queue provides EF service and is shown in Figure 40 as the EF queue.

Assured Forwarding (AF)
Assured forwarding service represents the DiffServ implementation of assured service, and both terms (assured forwarding and assured service) are used interchangeably in the following text. AF service guarantees a specific transmission rate but no delay guarantee. If idle resources exist, DiffServ can send excess traffic at a higher rate.

AF traffic is optionally metered and policed by means of the configuration in the policy. The supported policing types are single-rate and two-rate Three Color Marker (TCM). TCM enables packets to be classified or re-marked based on characteristics of the incoming traffic. Three classifications are provided: Green, Yellow, and Red. The policy provides for the specifying of thresholds for the color classification. The AF/BE queue provides AF service and is shown in Figure 40.

Best Effort (BE)
This is the standard best-effort service, which does not provide service or delay guarantees. You must strike a balance between reserving resources for EF and AF services, leaving enough resources free so that best-effort traffic receives adequate service. The AF/BE queue provides BE service and is shown in Figure 40.

Local routers create and send control packets, so you must also leave enough resources free so that they receive adequate service.

DiffServ metering, marking, and policing in an edge router enables the core router in DiffServ-enabled networks to classify packets based on DS (TOS) codepoint and control congestion by dropping non-conforming traffic or decreasing its service level. For example, the core router may discard all red packets, forward yellow packets as best effort, and forward green packet with a low drop probability. This helps to achieve increased throughput and lower delay for preferred traffic in DiffServ-enabled networks.

DiffServ is currently implemented on PPP, Multilink PPP, and Frame Relay links, and can be used by the RSVP subsystem. Figure 39 shows how packets of a stream are processed. When a router receives the first packet of a flow (assuming that it is designated for premium service), no indication of its service category exists in the DiffServ cache, so the packet is processed by the slow path. DiffServ invokes a search of the policy database to obtain the packet-handling criteria (policy). The policy-defined action is saved in the DiffServ cache. When the router receives a subsequent packet of this flow, it finds that an entry in the DiffServ cache for the flow already exists, so its policy-defined action is applied and the packet takes the fast path. Thus, subsequent packets from this flow receive premium service.

Figure 40 shows the relationship between the policer, buffer management, the queues, and the scheduler--some of the basic components that provide different quality of service levels.

Figure 40. Relationship of Policer, Buffers, Queues, and Scheduler


Figure of Relationship of Policer, Buffers, Queues, and Scheduler

The expedited forwarding (EF) and assured forwarding (AF) services have different characteristics, which are supported by three functions in the router: (1) The meter and policer, (2) buffer and queue management, and (3) the scheduler. These functions provide more sophisticated traffic control than is available in a traditional BE router device.

Once you have used the policy feature to configure appropriate policies, the first step in implementing DiffServ is to use the DiffServ enable ds command to enable the DiffServ feature, and the set interface command to enable the egress interface.

It is possible to configure DiffServ options such that the network resources are overcommitted or overbooked, that is, the traffic conditioner controls are configured as though there were more bandwidth or buffering than is actually available. DiffServ does not support overbooking.

If a DiffServ stream becomes idle (no packets have been sent on the stream for some time), the system reclaims the resources so other streams can use them. If the stream reactivates, the resources are returned to it. If the resources are no longer available because of overbooking, then DiffServ periodically attempts to reallocate the resources.

Understanding the DiffServ Codepoint

DiffServ provides a replacement header for the IPv4 TOS octet as defined in RFC791, which contains a byte called the Diffserv (DS) field (shown in Figure 41. The six high order bits of the DS field are used as a DiffServ codepoint (DSCP) to determine the per-hop-behavior (PHB). The remaining two bits are reserved for future use. The following example shows the format of the DS field:

Figure 41. DiffServ Codepoint Format for IPv4 TOS Octet Header


Format of DiffServ Codepoint in IPv4 TOS Octet Header


where:
     DSCP = differentiated services codepoint
     CU = currently unused

The recommended codepoint for the EF PHB is 101110xx.

Figure 42 shows the format of the DS field for the AF PHB:

Figure 42. DiffServ Codepoint Format for AF PHB Header


Format of DiffServ Codepoint for AF PHB Header


where:
     Three bits for AF class type
       001 - AF11 class
       010 - AF21 class
       011 - AF31 class
       100 - AF41 class
     Three bits for drop precedence
       010 - Low Drop Precedence, means Green color in TCM
       100 - Medium Drop Precedence, means Yellow color in TCM
       110 - High Drop Precedence, means Red color in TCM
     CU = currently unused

The following list shows the recommended AF codepoint values with AF classes and drop precedence values:
Class 1 Class 2 Class 3 Class 4
AF11 = 001010xx AF21 = 010010xx AF31 = 011010xx AF41 = 100010xx
AF12 = 001100xx AF22 = 010100xx AF32 = 011100xx AF42 = 100100xx
AF13 = 001110xx AF23 = 010110xx AF33 = 011110xx AF43 = 100110xx

Understanding the Meters and Policer

Metering and policing is provided for EF and AF traffic as specified in policy. The EF algorithm meters the traffic and drops packets that are over the specified threshold. The AF algorithm meters the traffic and possibly re-marks packets, but does not drop.

Expedited Forwarding (EF)

EF traffic has a default, token bucket-based policer, which drops packets if they exceed the rate specified during policy bandwidth parameter setup. You may specify the Token Rate (TR) and Token Bucket Size (TBS) parameters to change the policer default operation. The meter determines whether the bucket contains a sufficient number of tokens to send a packet. If tokens are available, the packet is sent. If not, the policer drops the packet. The bucket replenishes tokens at the rate specified in the Token Rate parameter. The token rate is measured in bytes per second, that is, it includes the IP header, but not link-specific headers. The token rate is measured before the IP header compression and Layer 2 data encryption and compression. Token Bucket Size is used to handle temporary bursts over the rate limit without penalty.

Assured Forwarding (AF)

AF traffic has three policing options: (1) single-rate Three Color Marker (srTCM), (2) two-rate Three Color Marker (trTCM), and (3) none (no policing). These policing options are available for AF1, AF2, AF3 and AF4 classes and are specified during policy setup.

The srTCM meters a traffic stream based on a token bucket algorithm with two buckets and a single replenishment rate. It marks its packets as either green, yellow, or red according to three traffic parameters: (1) Committed Information Rate (CIR), (2) Committed Burst Size (CBS), and (3) Excess Burst Size (EBS). A packet is marked green if it does not exceed the CBS, yellow if it does exceed the CBS but not the EBS, and red otherwise. The CIR is measured in bytes of IP packets per second, that is, it includes the IP header, but not link-specific headers. The CIR is measured before the IP header compression and Layer 2 data encryption and compression. The CBS and the EBS are measured in bytes.

The meter operates in either color-blind or color-aware mode. In color-blind mode, an incoming packet is assumed to be marked green, regardless of the setting of the drop precedence bits in its DS codepoint. CBS represents the size of the green bucket, and EBS represents the size of the yellow bucket. First, the green bucket is checked for available tokens. If there are enough green tokens, then the packet is marked as green and sent. If there are not enough green tokens, then the yellow bucket is checked. If there are enough yellow tokens, then the packet is marked as yellow and sent. If there are not enough yellow tokens, then the packet is marked as red. In color-aware mode, the color of the incoming packet is checked and the corresponding token bucket is checked first. If tokens are available it is sent as received. If not, its drop precedence value is reduced appropriately. Color-aware mode is useful if ingress packets are already classified and pre-color marked.

The trTCM is also a token bucket algorithm, similar to srTCM, except that it provides separate replenishment rates for the green and yellow buckets. The configuration parameters are: (1) Committed Information Rate (CIR), (2) Committed Burst Size (CBS), (3) Peak Information Rate (PIR), and (4) Peak Burst Size (PBS). CBS represents the size of the green bucket, and PBS represents the size of the yellow bucket. The algorithm is the same as for srTCM, except that the CIR value determines the green bucket replenishment rate and the PIR value determines the yellow bucket replenishment rate. The trTCM is useful if a peak rate needs to be enforced separately from a committed information rate. The packets that exceed the PIR will be marked red (highest drop probability).

Understanding Buffer and Queue Management

If traffic is for EF, or is AF or BE traffic that the policer has allowed, the rate-based buffer management function processes it. This function allocates buffers from either a private pool or from a common shared pool for the DiffServ-enabled output interface. Buffers for EF traffic are allocated only from the private pool.

Use the Talk 6 set receive-buffers configuration command (see Access Integration Services Software User's Guide for a description and the syntax) to specify the total amount of physical buffer space available to an interface. Use the DiffServ Talk 6 set interface command to set the egress buffer size for the premium and assured queues. This is the buffer space that DiffServ manages.

DiffServ manages two separate pools--one for the premium (EF) queue and one for the assured forwarding (AF) queue. Ensure that the buffer space you specify reflects the actual amount of buffer space available in the system.

Buffer management determines whether buffers from its interface's private pool are available for the packet. If there are, it accepts and enqueues the packet. If they are not, it attempts to allocate buffer space from the shared pool and if it can, it enqueues the packet. If no shared buffer space is available, buffer management drops the packet.

Understanding the Scheduler

The scheduler function examines the queues on a regular basis, dequeues enqueued packets, and sends them to the interface adapter for transmission. It is a self-clocked fair-queuing scheduler, which is a variation of weighted fair queuing. You may configure the scheduler weights and specify the frequency at which the scheduler examines the queues.


Differentiated Services Terminology

The following terms are used when discussing DiffServ:

Committed Information Rate (CIR)
This parameter specifies the maximum rate at which a user's AF traffic stream is allowed to operate before becoming considered as oversending. It is measured in bytes of IP packets per second (including the IP header but not the link-specific headers). This is used by both the single-rate and two-rate TCM functions for AF streams.

Committed Burst Size (CBS)
This parameter specifies (in bytes of IP packets) the maximum number of bytes that can be sent out in a burst, at a rate exceeding the CIR. The CBS limits the size of the committed token bucket in both the single-rate TCM and two-rate TCM functions.

DiffServ Cache
This cache contains the traffic and service profile of the most recently active IP flows being serviced by the router.

Excess Burst Size (EBS)
This parameter specifies (in bytes of IP packets) the maximum number of bytes that can be sent out in a burst in excess of the CBS, at a rate exceeding the CIR. This parameter is used by the single-rate TCM functions, and limits the size of the excess token bucket.

Flow
A sequence of packets with the same source address and port, IP protocol, and destination address and port.

Token Rate
This parameter specifies the maximum rate at which a user's EF traffic stream is allowed to operate before being considered as oversending. It is measured in bytes of IP packets per second (including the IP header but not the link-specific headers).

Token Bucket Size
This parameter measures the maximum number of bytes of IP packets of an EF traffic stream that can be sent out in a burst at a rate exceeding the token rate.

Peak Bucket Size (PBS)
This parameter is used only by the two-rate TCM functions. It specifies (in bytes of IP packets) the maximum number of bytes that can be sent out in a burst at a rate exceeding the PIR. This parameter limits the maximum size of the peak token bucket.

Peak Information Rate (PIR)
This parameter is used by the two-rate TCM functions only. It represents the peak rate (in bytes of IP packets per second, including the IP header but not the link-specific headers) at which the user can send AF stream packets, beyond which the drop priority of the packet is set to the highest value.

Stream
An aggregation of flows.

Virtual Interface (VIF)
For Frame Relay links, each DLCI connection is considered to be a virtual interface.

Configuring Differentiated Services

The following procedures provide a high-level description of how to configure DiffServ to provide preferred service for selected packets. First, access the DiffServ feature:

  1. At the * prompt, enter talk 6.
  2. At the Config> prompt, enter feature ds. This displays the DS config> prompt and opens the configuration dialog.
    * talk 6
    Config>feature ds
    DS config>
     
     
    
  3. Enable the DiffServ feature on a router:
    DS config>enable ds
    DiffServ enabled
     
     
    
  4. Enable and set the interface parameters:
    DS config>set interface
    Enter Diffserv Interface number [0]? 2
    Set Premium Queue Bandwidth (%) (1 - 99) [20]? 
        Assured Queue Bandwidth (%) = 80
    Configure Advanced setting (y/n)? [No]: no
    Accept input (y/n)? [Yes]:
     
    
    Note:If you specify no to the Configure Advanced setting prompt, then default parameters for Premium Queue and Assured/BE queue will be used.
     
    Configure Advanced setting (y/n)? [No]: yes
    Set Premium Queue Weight (%) (20 - 99) [90]? 
        Assured Queue Weight (%) = 10
    EGRESS BufSize for Premium Queue (in bytes) (550 - 27500) [5500]?
    Max EGRESS QoS Allocation for Premium Queue (%) (1 - 99) [95]?
    EGRESS BufSize for Assured/BE Queue (in bytes) (5500 - 140800) [27500]?
    Max EGRESS QoS Allocation for Assured/BE Queue (%) (1 - 99) [80]?
     
    

    In this example, 20 percent of line bandwidth, and 90 percent of scheduler weight are given to the EF queue. The egress buffer size for the EF queue is 5500 bytes (which is 10 packets with an average packet size of 550 bytes), out of which 95 percent is allocatable to QoS streams. The egress buffer size for the AF/BE queue is 27 500 bytes (which is 50 packets with an average packet size of 550 bytes), out of which 80 percent is allocatable to QoS streams.

     

  5. When you have finished enabling DiffServ on routers and setting interface parameters, enter Ctrl-P to return to the * prompt.

After enabling DiffServ and setting interface parameters, you must restart or reload the device to activate DiffServ. For more details on specifying DiffServ commands, see "Configuring and Monitoring the Differentiated Services Feature".


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]